import React from 'react'
import { BrowserRouter, Route, Switch, withRouter, Link, Navlink } from './react-router-dom'
// import { BrowserRouter, Route, Switch, withRouter, Link } from 'react-router-dom'
const Page1 = () => <h1>Page1</h1>
const Page2 = () => <h1>Page2</h1>
export default function App() {
    return (
        <BrowserRouter>
            <Switch>
                <Route path="/page1" component={Page1} />
                <Route path="/page2" component={Page2} />
            </Switch>
            <div>
                <Navlink to="/page1">topage1</Navlink>
                <Link to={{
                    pathname: '/page2',
                    search: "?a=b"
                }} > topage2</Link>
            </div>
        </BrowserRouter>
    )
}
